package com.xiaobaibai.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.xiaobaibai.valid.AddGroup;
import com.xiaobaibai.valid.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.extern.slf4j.Slf4j;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author xiaobaibai
 * @since 2020-11-23
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("distribution_user")
@ApiModel(value="DistributionUser对象", description="")
public class DistributionUser implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "分销表主键")
    @TableId(value = "id", type = IdType.AUTO)
    @Null(message = "参数错误")
    private Integer id;

    @ApiModelProperty(value = "用户id")
    @TableField("user_id")
    @Null(message = "参数错误")
    private Integer userId;

    @ApiModelProperty(value = "本人邀请码")
    @TableField("invitation_code")
    @Null(message = "参数错误")
    private String invitationCode;

    @ApiModelProperty(value = "上级邀请码(可为空)")
    @TableField("superior_code")
    @Null(message = "参数错误,不可指定上级")
    private String superiorCode;

    @ApiModelProperty(value = "余额")
    @TableField("amount")
    @Null(message = "参数错误")
    private BigDecimal amount;

    @ApiModelProperty(value = "微信号")
    @TableField("weixin_number")
    @NotNull(message = "请填写微信号")
    private String weixinNumber;

    @ApiModelProperty(value = "手机号码")
    @TableField("phone")
    @NotNull(message = "请填写手机号")
    @Pattern(regexp = "^1[1-9][0-9]\\d{8}$",message = "请填写正确的手机号")
    private String phone;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty(value = "修改时间")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

}
